<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <script src="/static/js/jquery-1.12.4.min.js"></script>
    <script>
        $(function () {
            $('#caculate').click(function () {

                //　获得a、b值
                a = $('#a_val').val();
                b = $('#b_val').val();

                $.get('/view/ajax/', {'a': a, 'b': b}, function (data) {
                    $('#result').val(data.result);
                });
            });
        });
    </script>
</head>
<body>
<table>
    <tr><td>a:</td><td><input type="text" name="a" id="a_val"></td></tr>
    <tr><td>b:</td><td><input type="text" name="b" id="b_val"></td></tr>
    <tr><td><input type="button" id="caculate" value="计算"></td><td><input type="text" id="result"></td></tr>
</table>
</body>
</html>
